package com.leilei.dao.impl;

import com.leilei.dao.IUserDao;
import com.leilei.entity.User;
import com.leilei.service.IUserService;

import java.util.List;

public class UserServiceImpl implements IUserService {

    private IUserDao userDao = new UserDaoImpl();

    @Override
    public int selectUidByUsername(String username) {

        return userDao.selectUidByUsername(username);
    }

    @Override
    public User selectUserByUP(String username, String password) {

        return userDao.selectUserByUP(username, password);
    }

    @Override
    public User selectUserByUid(int uid) {

        return userDao.selectUserByUid(uid);
    }

    @Override
    public List<User> selectAllUser() {

        return userDao.selectAllUser();
    }

    @Override
    public boolean saveUser(User user) {

        return userDao.saveUser(user) > 0;
    }

    @Override
    public boolean updateUser(User user) {

        return userDao.updateUser(user) > 0;
    }
}
